/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.hugo.senai.dao;

import org.hibernate.Session;

/**
 *
 * @author Hugo
 */
public class SimpleSession {
    
    Session s = HibernateUtil.getSessionFactory().openSession();
    
    public void beginTransaction(){
        s.getTransaction().begin();
    }
    
    public void commit(){
        s.getTransaction().commit();
    }
    
    public void close(){
        s.close();
        
                
    }
    
    public void rollback(){
        s.getTransaction().rollback();
    }
    
    public Session getSession(){
        return s;
    }
    
}
